import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue'

import Autoimport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';

import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
import path from 'node:path';
export default defineConfig({
    optimizeDeps: {
        exclude: [] // 不进行预构建的包
    },
    envDir: "", // env 配置文件路径
    envPrefix: 'ENV_',  // 环境变量前缀,客户端根据这个前缀查找环境变量配置文件中拥有这个前缀的变量名
    css: {
        modules: { // 设置css模块化的默认行为
            // localsConvention: 'camelCase', // css类名名为采用驼峰形式 默认dashesonly 中划线
        },
        preprocessorOptions: {
            scss: { api: 'modern-compiler' },
        }
    },
    plugins: [
        vue(),
        Autoimport({
            resolvers: [ElementPlusResolver()],
        }),
        Components({
            resolvers: [ElementPlusResolver()],
        }),
    ],
    base: './',
    resolve: {
        alias: { // 定义路径别名
            '@': path.resolve(__dirname, './src')
        }
    },
});